package org.come.control;

import org.come.Jpanel.FrameMessageChangeJpanel;
import org.come.action.NpcMenuAction;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.UserData;

import com.tool.role.RoleData;

public class CompulsoryDivorceControl implements NpcMenuAction {

	@Override
	public void menuControl(String type) {
			
		if("确定".equals(type)){
			compulsoryDivorce(RoleData.getRoleData().getLoginResult().getMarryObject());
		}else if("我再考虑考虑".equals(type)){
				
		}
	}
	
	//强制离婚的方法
	public void compulsoryDivorce(String former){
		//先判断离婚人有没有5000W两
		if(!UserData.uptael(50000000)){//没有	
			FrameMessageChangeJpanel.addtext(6,"您支付不起5000W的离婚费用！！",null,null);
			return;
		}
		//向服务器发送离婚请求
		String mes =  Agreement.getAgreement().unMarry("");
		// 发送给服务器
		SendMessageUntil.toServer(mes);
		
	}
}


